<template>
  <div class="prod" @click="handleDetail">
    <!-- <router-link to="/detail"> -->
      <img :src="gdata.image_scene+'?x-oss-process=style/w400-webp'" alt="" />
      <h3 class="fs-28 m-t-10">{{ gdata.name }}</h3>
      <p class="fs-24 color-red m-t-10">￥{{ gdata.min_price }}</p>
      <p class="fs-18 m-t-10 m-b-15">{{ gdata.sub_title }}</p>
    <!-- </router-link> -->
  </div>
</template>

<script setup>
import {useRouter} from 'vue-router'
let props = defineProps({
  gdata:{
    type:Object,
    required:true
  }
})
let router = useRouter()  //替代this.$router
let handleDetail = ()=>{
  console.log(1111,props.gdata);
  let {id} = props.gdata
  router.push({
    path:'/detail',
    query:{id}
  })
}
</script>

<style lang="less" scoped>

</style>